package com.lsh.payment.core.service.payIcp.impl;

import com.lsh.payment.core.dao.payIcp.MerchantInfoMapper;
import com.lsh.payment.core.model.icp.MerchantInfo;
import com.lsh.payment.core.service.payIcp.IMerchantInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * Project Name: lsh-payment
 * Created by peter on 17/10/26.
 * 北京链商电子商务有限公司
 * Package
 * desc:
 */
@Service
@Transactional(readOnly = true)
public class MerchantInfoServiceImpl implements IMerchantInfoService {

    @Autowired
    private MerchantInfoMapper merchantInfoMapper;


    @Override
    @Transactional(rollbackFor = Exception.class)
    public int addMerchant(MerchantInfo merchantInfo) {
        return merchantInfoMapper.insertSelective(merchantInfo);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public int updateMerchant(MerchantInfo merchantInfo) {
        return merchantInfoMapper.updateByPrimaryKeySelective(merchantInfo);
    }

    @Override
    public MerchantInfo selectByTranflow(String tranflow) {
        return merchantInfoMapper.selectByTranflow(tranflow);
    }
}
